-
Notifications
You must be signed in to change notification settings - Fork 5
Mem3DG converter #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mem3DG converter #195
Conversation
… alongside the simularium file
| object_display_data = DisplayData( | ||
| name=f"{base_agent_name}#frame{frame}", | ||
| display_type=DISPLAY_TYPE.OBJ, | ||
| url=f"{frame}.obj", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice job fixing the path issue! The different between url and output_file_path isn't immediately clear, perhaps rename url to clarify?
interim17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, haven' run it.
The multiple .obj to one simualarium file pattern is interesting to me. It reminds me a bit of .zarr and seems like a way we could approach have different levels of resolution in a simularium file going forward if and when we take a look at the file structure or aim to work on that feature.
Time estimate or Size
Medium-ish
Problem
Creating a new converter for Mem3DG output data
Link to story or ticket
Solution
This converter ended up different than the normal simulariumio converters. Mem3DG creates a single .nc file, which in all the examples I successfully ran looks like a mesh object that changes across the timesteps.
The best / only way I came up with to bring this into simularium was to take the mesh data at each time stamp and convert that into a .obj mesh file, which simularium knows how to render. Then, generate a simularium file that references each of these generated mesh files.
This does work, but we have these pieces that are different than the "normal" simulariumio / simularium pattern
Also one outstanding question I have not yet answered: is there a situation in which a single .nc file would represent multiple distinct meshes? This converter code currently assumes one .nc file -> 1 mesh agent per timestep -> 1 .obj file generated per timestep.
Type of change
Change summary:
Mem3dgData, unit tests, and jupyter notebook example)Steps to Verify:
The best way to test this would be by checking out this branch and trying the Jupyter Notebook tutorial file! If it anything doesn't work or if it's confusing, that is all helpful feedback :)